package com.changeover.gwt.client.controller;

import com.changeover.gwt.client.view.ICustomerDetails;
import com.google.gwt.event.shared.HandlerManager;
import com.google.gwt.user.client.ui.HasWidgets;

public class CustomerDetailsController implements Controller {
    
    private final ICustomerDetails view;
    private final HandlerManager eventBus;
    
    public CustomerDetailsController(HandlerManager eventBus, ICustomerDetails view) {
        this.eventBus = eventBus;
        this.view = view;
    }
    
    @Override
    public void go(HasWidgets container) {
        bind();
        container.clear();
        container.add(view.asWidget());
    }
    
    private void bind() {
//        eventBus.addHandler(CustomerDetailsEvent.TYPE, new ICustomerDetailsEventHandler() {
//            
//            @Override
//            public void onDoubleClickTable(CustomerDetailsEvent event) {
//                view.getCustomerDetailsDialog().show();
//            }
//        });
        
    }
}
